#include <iostream>
#include <string>
#include <string.h>
using namespace std;
int main()
{
	int n;
	scanf("%d", &n);
	char c;
	scanf("%c", &c);
	c = getchar();
	getchar();
	char str[100100];
	gets(str);
	int length = strlen(str);
//	cout << length << endl;
	if(length == n)
		cout << str;
	if (length < n)
	{
		int k = n - length;
		for (int i = 0; i < k; i++)
		{
			cout << c;
		}
		cout << str;
	}
	if(length > n)
	{
		int skip = length - n;
		for (int i = skip; i < length; i++)
		{
			cout << str[i];
		}
	}
	return 0;
}